cleanup: normalize ZERO/ONE constant order in TESTING/EIG error-exit tests#1236
cleanup: normalize ZERO/ONE constant order in TESTING/EIG error-exit tests#1236nakatamaho wants to merge 1 commit intoReference-LAPACK:masterfrom
Conversation
…it tests Reorder ZERO and ONE declarations and PARAMETER definitions for consistency in the TESTING/EIG error-exit test sources. No functional change intended.
|
On the one hand, I think LAPACK has been trying to keep alphabetical order when declaring variable. Lines 209 to 238 in f6fb111 In that sense, first ONE then ZERO makes sense to me. On the other hand, this specific * .. Parameters ..
DOUBLE PRECISION ZERO, ONE
PARAMETER ( ZERO = 0.0D0, ONE = 1.0D0 )is really not consistent in LAPACK. We can see that 176 subroutines uses first ZERO then ONE, and 96 subroutines use first ONE then ZERO. All in all, I am fine with anything. I am fine going one way, or the other way, or leaving it all as the mess it is. Not everything has to be consistent. But happy to approve the pull request. |
|
Thanks for the flexibility and for approving. That said, one thing I’ve learned through this process is that we do need some level of code discipline. Otherwise we keep revisiting the same style/consistency issues in every PR. My current thinking is:
For example:
To make this explicit and reduce ambiguity, I propose adding a short guideline document (e.g., CODE_DISCIPLINE.md). I can draft an initial version if that sounds reasonable. |
This PR normalizes the declaration and PARAMETER definition order
of the named constants ZERO and ONE across TESTING/EIG error-exit
test routines:
Specifically, the order is unified to:
ZERO, ONE
This matches the prevailing style used in other parts of LAPACK
and improves consistency for automated translation and maintenance
(e.g., fable-based workflows in MPLAPACK).
No functional changes are intended. This is a pure cleanup.